package com.rc.web.controller;

import com.rc.pojo.vo.dashboard.*;
import com.rc.pojo.vo.order.FirstFiveMonthOrderVO;
import com.rc.web.service.DashboardService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@RestController
@RequestMapping("/dashboard")
@Api(tags = "数据台")
@RequiredArgsConstructor
public class DashboardController {
    private final DashboardService dashboardService;

    @GetMapping("/firstFiveMonth")
    @ApiOperation("过去五个月订单额")
    public List<FirstFiveMonthOrderVO> getfirstFiveMonth(){
        return dashboardService.getfirstFiveMonth();
    }

    @GetMapping("/totalNum")
    @ApiOperation("数据统计")
    public TotalNumVO getTotalNum(){
        return dashboardService.getTotalNum();
    }

    @GetMapping("/todayTotalNum")
    @ApiOperation("数据统计")
    public TodayTotalNumVO getTodayTotalNum(){
        return dashboardService.getTodayTotalNum();
    }

    @GetMapping("/plantDistribution")
    @ApiOperation("植物分布")
    public List<PlantDistributionVO> getPlantDistribution(){
        return dashboardService.getPlantDistribution();
    }


    @GetMapping("/monthTotal")
    @ApiOperation("管理员本月和总数")
    public MonthTotalVO monthUserVO(){
        return dashboardService.getMonthUser();
    }

    @GetMapping("/farmDistribution")
    public List<FarmDistributionVO> getFarmDistribution(){
        return dashboardService.getFarmDistribution();
    }

}
